/**
 * 
 */
package com.thor.palmmall.rest.hdmall.sales.converter;

import org.springframework.core.convert.converter.Converter;

import com.thor.palmmall.hdmall.sales.HDMSalesInputLine;
import com.thor.palmmall.rest.hdmall.sales.MSalesInputLine;
/**
 * @author:liyang
 * @time:2017年7月25日 下午4:14:16
 * @since:1.0
 */
public class HDMSalesInputLineConverter implements Converter<MSalesInputLine, HDMSalesInputLine> {

  public static HDMSalesInputLineConverter getInstance() {
    if (instance == null)
      instance = new HDMSalesInputLineConverter();
    return instance;
  }

  private static HDMSalesInputLineConverter instance;

  private HDMSalesInputLineConverter() {
  }

  @Override
  public HDMSalesInputLine convert(MSalesInputLine source) {
    if (source == null) {
      return null;
    }
    HDMSalesInputLine target = new HDMSalesInputLine();
    target.setPayment(source.getPayment());
    target.setTotal(source.getTotal());
    return target;
  }

}
